package org.millioncall.yueyoga.admin.dao.impl;

import java.util.Map;

import org.millioncall.yueyoga.admin.dao.BaseDao;
import org.millioncall.yueyoga.admin.dao.UserDetailDAO;
import org.millioncall.yueyoga.admin.model.UserDetail;
import org.springframework.stereotype.Repository;

@Repository
public class UserDetailDAOImpl extends BaseDao implements UserDetailDAO {

	@Override
	public UserDetail findUserDetailById(String id) {
		UserDetail userDetail = null;
		userDetail = this.getPagableSqlSessionTemplate().selectOne(
				"findUserDetailByUId", id);
		return userDetail;
	}

	@Override
	public int updateUserDetail(Map<String, Object> map) {
		return this.getPagableSqlSessionTemplate().update("updateUserDetail",
				map);
	}

	@Override
	public int saveUserDetail(Map<String, Object> map) {
		return this.save("saveUserDetail", map);
	}

	@Override
	public UserDetail findUserDetailByName(Map<String, Object> map) {
		return this.getPagableSqlSessionTemplate().selectOne(
				"findUserDetailByName", map);
	}
}
